<?php $aPos = unserialize(ADVERTISE_POST_ARRAY); ?>
<div class="row">
    <div class="col-md-12">
        <h1>Quảng cáo <small>Danh sách tin quảng cáo</small></h1>
        <ol class="breadcrumb">
            <li><a href="<?php echo mns_page_url(); ?>"><i class="fa fa-dashboard"></i> Dashboard</a></li>
            <li class="active"><i class="fa fa-table"></i> Các tin hiện có</li>
        </ol>
    </div>
</div>

<div class="row">
    <div class="col-md-12 col-xs-12">
        <p class="pull-right">
            <a class="btn btn-success" href="<?php echo mns_page_url(ADVERTISE_SLUG.'/dang-ki-moi'); ?>">
                <i class='glyphicon glyphicon-plus-sign'></i> Đăng kí mới
            </a>
        </p>
        <div class="pull-right mgr5"><?php echo isset($pagingBar) && strlen($pagingBar)>0?$pagingBar:''; ?></div>
    </div>
    <div class="clearfix"></div>

    <div class="col-md-12">
        <div class="table-responsive">
            <table class="table table-bordered table-hover tablesorter item-list" data-href='<?php echo mns_page_url(ADVERTISE_SLUG.'/cap-nhat-trang-thai'); ?>'>
                <thead>
                    <tr>
                        <th class="header"># <i class="fa fa-sort"></i></th>
                        <th class="header">Nội dung</i></th>
                        <th class="header">Vị trí <i class="fa fa-sort"></i></th>
                        <th class="header">Liên kết <i class="fa fa-sort"></i></th>
                        <th class="header">Ngày bắt đầu <i class="fa fa-sort"></i></th>
                        <th class="header">Ngày kết thúc <i class="fa fa-sort"></i></th>
                        <th class="header">Xoá</th>
                    </tr>
                </thead>
                <tbody>
                    <?php foreach($aAds as $index=>$a) { ?>
                    <tr class="can-edit" data-id="<?php echo $this->encrypt->encode($a->getId()); ?>">
                        <th class="header bg-info"><?php echo $index+1; ?></th>
                        <td class="input-advertise-content">
                            <a href="#" class="thumbnail maxW-365">
                                <?php echo $a->getContent(); ?>
                            </a>
                        </td>
                        <td class="input-advertise-position"><?php echo $aPos[$a->getPosition()]; ?></td>
                        <td class="input-advertise-link">
                            <a target="_blank" href="<?php echo $a->getAnchor();?>" class="btn btn-warning">
                                <i class="glyphicon glyphicon-share-alt"></i> Đi đến
                            </a>
                        </td>
                        <td class="input-advertise-start"><?php echo $a->getStartDate(); ?></td>
                        <td class="input-advertise-end"><?php echo $a->getEndDate(); ?></td>
                        <td class="input-advertise-publish">
                            <input id="chk-publish-<?php echo $a->getId(); ?>" type="checkbox" class="input-advertise-publish-flg lb-toggle"
                                disabled='disabled' <?php echo $a->getPublishFlg()==1 && $a->getDeletedAt()==null?"checked='checked'":""; ?> />
                            <label for="chk-publish-<?php echo $a->getId(); ?>"></label>
                        </td>
                    </tr>
                    <?php } ?>
                </tbody>
            </table>
        </div>
    </div>
    <div class="clearfix"></div>
</div>